﻿<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>FSF.FarNameToKey</title>
<meta http-equiv="Content-Type" Content="text/html; charset=utf-8">
<link rel="stylesheet" type="text/css" href="../../styles/styles.css">
<script language="javascript" src='../links.js' type="text/javascript"></script>
</head>

<body>

<h1>FarNameToKey</h1>
<div class=navbar>
<a href="../index.html">main</a> |
<a href="index.html">FarStandardFunctions</a>
</div>

<div class=shortdescr>
The <dfn>FSF.FarNameToKey</dfn> is used to convert a literal key name to
an internal FAR <a href="../defs/farkeycodes.html">key code</a>.
</div>

<pre class=syntax>
int WINAPI FarNameToKey(
  const char *Name
);
</pre>

<h3>Parameters</h3>
<div class=descr>
  <div class=dfn>Name</div>
  <div class=dfndescr>Points to a string containing a literal key name that you want to convert to an internal FAR key code.
  </div>
</div>

<h3>Return value</h3>
<div class=descr>
If conversion succeeds an internal FAR <a href="../defs/farkeycodes.html">key code</a> is returned,
otherwise if the passed <em>Name</em> is not known to FAR, -1 is returned.
</div>

<h3>Remarks</h3>
<div class=descr>
<ol>
<li>If the literal key name contains <kbd>Ctrl</kbd> or <kbd>Alt</kbd> part and the "letter",
    this "letter" will be uppercased. For example, <code>FarNameToKey("CtrlAltz")</code> will return <kbd>KEY_CTRLALTZ</kbd>.

<li>If the literal key name contains <kbd>Ctrl</kbd> or <kbd>Alt</kbd> and the "letter from
    the national alphabet" - this "letter" will be converted to it's keyboard equivalent and
    uppercased. For example, <code>FarNameToKey("CtrlÓ")</code> will return <kbd>KEY_CTRLE</kbd>.

<li><kbd>Shift</kbd>-"letter" combination will be converted to the "LETTER" key
   (<kbd>Shift</kbd> part will be removed and the "letter" will be uppercased).
</ol>
</div>

</body>
</html>
